package org.domain.seamproject.session;

import org.domain.seamproject.entity.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import java.util.Arrays;

@Name("mytableList")
public class MytableList extends EntityQuery<Mytable> {

	private static final String EJBQL = "select mytable from Mytable mytable";

	private static final String[] RESTRICTIONS = {
			"lower(mytable.userName) like lower(concat(#{mytableList.mytable.userName},'%'))",
			"lower(mytable.password) like lower(concat(#{mytableList.mytable.password},'%'))",
			"lower(mytable.name) like lower(concat(#{mytableList.mytable.name},'%'))",
			"lower(mytable.email) like lower(concat(#{mytableList.mytable.email},'%'))", };

	private Mytable mytable = new Mytable();

	public MytableList() {
		setEjbql(EJBQL);
		setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
		setMaxResults(25);
	}

	public Mytable getMytable() {
		return mytable;
	}
}
